package action_行为型.iterator_pattern_迭代器模式;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/08/14:57
 * @Description:
 */
public class IteratorPatternDemo {
	public static void main(String[] args) {

		NamesRepository namesRepository = new NamesRepository();
		MYIterator<String> iterator = namesRepository.getIterator();
		while (iterator.hasNext()) {
			String next = iterator.next();
			System.err.println(next);
		}

		Iterator<Object> iterator1 = new ArrayList<Object>().iterator();
		iterator1.hasNext();

	}
}
